import 'dart:convert';
import 'dart:developer';

import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_saixiaoli/pages/activity/activeDetail/activeDetail.dart';
import 'package:flutter_saixiaoli/pages/activity/activeDetail/signUp/signUp.dart';
import 'package:flutter_saixiaoli/pages/activity/activity.dart';
import 'package:flutter_saixiaoli/pages/activity/match/matchDetail.dart';
import 'package:flutter_saixiaoli/pages/community/community.dart';
import 'package:flutter_saixiaoli/pages/home/home.dart';
import 'package:flutter_saixiaoli/pages/home/live/face.dart';
import 'package:flutter_saixiaoli/pages/home/live/faceRes.dart';
import 'package:flutter_saixiaoli/pages/home/live/live.dart';
import 'package:flutter_saixiaoli/pages/home/scoreQuery/certificateQuery.dart';
import 'package:flutter_saixiaoli/pages/home/scoreQuery/scoreQuery.dart';
import 'package:flutter_saixiaoli/pages/home/scoreQuery/scoreQueryList.dart';

import 'package:flutter_saixiaoli/pages/home/selected/selectedDetail.dart';
import 'package:flutter_saixiaoli/pages/index/index.dart';
import 'package:flutter_saixiaoli/pages/mine/mine.dart';
import 'package:flutter_saixiaoli/pages/shop/shop.dart';

class Routes {
  static FluroRouter router = FluroRouter();

  //定义路由名称
  static String index = '/';
  static String home = '/home';
  static String activity = '/activity'; //活动
  static String community = '/community'; //社区
  static String mine = '/mine'; //我的
  static String shop = '/shop'; //商城
  static String live = '/live'; //相册直播
  static String face = '/face'; //人脸识别
  static String faceRes = '/faceRes'; //人脸识别结果
  static String selectedDetail = '/selectedDetail'; //精选游记详情
  static String scoreQueryList = '/scoreQueryList'; //成绩查询列表
  static String scoreQuery = '/scoreQuery'; //成绩查询
  static String certificateQuery = '/certificateQuery'; //证书查询
  static String activeDetail = '/activeDetail'; //活动详情
  static String signUp = '/signUp'; //选择团期
  static String matchDetail = '/matchDetail'; //赛事详情
  //定义路由处理函数
  static var _indexHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Index();
  });
  static var _homeHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Home();
  });
  static var _activityHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Activity();
  });
  static var _mineHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Mine();
  });
  static var _shopHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Shop();
  });
  static var _communityHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Community();
  });
  static var _liveHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Live();
  });
  static var _faceHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Face();
  });
  static var _faceResHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return FaceRes();
  });
  static var _selectedDetailHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return SelectedDetail();
  });
  static var _scoreQueryListlHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return ScoreQueryList();
  });
  static var _scoreQuerylHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return ScoreQuery();
  });
  static var _certificateQuerylHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return CertificateQuery();
  });
  static var _activeDetailHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return ActiveDetail();
  });
  static var _signUpHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return SignUp();
  });
  static var _matchDetailHandler =
  Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return MatchDetail();
  });
  static void configureRoutes(FluroRouter router) {
    router.define(index, handler: _indexHandler);
    router.define(home, handler: _homeHandler);
    router.define(activity, handler: _activityHandler);
    router.define(community, handler: _communityHandler);
    router.define(shop, handler: _shopHandler);
    router.define(mine, handler: _mineHandler);
    router.define(live, handler: _liveHandler);
    router.define(face, handler: _faceHandler);
    router.define(faceRes, handler: _faceResHandler);
    router.define(selectedDetail, handler: _selectedDetailHandler);
    router.define(scoreQueryList, handler: _scoreQueryListlHandler);
    router.define(scoreQuery, handler: _scoreQuerylHandler);
    router.define(certificateQuery, handler: _certificateQuerylHandler);
    router.define(activeDetail, handler: _activeDetailHandler);
    router.define(signUp, handler: _signUpHandler);
    router.define(matchDetail, handler: _matchDetailHandler);
    // router.notFoundHandler = _NotFoundHandler;
  }
}
